/*
 * price.cpp
 *
 *  Created on: Feb 24, 2016
 *      Author: ezhaome
 */

#include "price.h"
#include "movie.h"

int Price::getFrequentPoints(int daysRented)
{
	return 1;
}

int ChildrenPrice::getPriceCode()
{
	return Movie::CHILDREN;
}

double ChildrenPrice::getCharge(int daysRented)
{
	double result = 1.5;
	if (daysRented > 3)
	{
		result += (daysRented - 3) * 1.5;
	}
	return result;
}

int RegularPrice::getPriceCode()
{
	return Movie::REGULAR;
}

double RegularPrice::getCharge(int daysRented)
{
	double result = 2;
	if(daysRented > 2)
	{
		result += (daysRented - 2) * 1.5;
	}
	return result;
}

int NewReleasePrice::getPriceCode()
{
	return Movie::NEW_RELEASE;
}

double NewReleasePrice::getCharge(int daysRented)
{
	return daysRented * 3;
}

int getFrequentPoints(int daysRented)
{
	if (daysRented > 1)
		return 2;
	else
		return 1;
}
